package com.leeon.container;

import java.util.*;

import static net.mindview.util.Print.print;

public class PrintingContainers {

    static Collection fill(Collection<String> collection){
        collection.add("Rat");
        collection.add("Cat");
        collection.add("Dog");
        collection.add("Dog");
        return collection;
    }

    static Map fill(Map<String,String> map){
        map.put("rat","Fuzzy");
        map.put("cat","Rags");
        map.put("dog","Bosco");
        return map;
    }

    static void display(Iterator<String> it){
        while (it.hasNext()){
            print(it.next());
        }
    }

    public static void main(String[] agrs){
/*        System.out.println(fill(new ArrayList<String>()));
        System.out.println(fill(new LinkedList<String>()));
        System.out.println(fill(new HashSet<String>()));
        System.out.println(fill(new TreeSet<>()));
        System.out.println(fill(new LinkedHashSet<>()));
        System.out.println(fill(new HashMap<>()));
        System.out.println(fill(new TreeMap<>()));
        System.out.println(fill(new LinkedHashMap<>()));*/
        List<String> strings = new ArrayList<String>();
        fill(strings);
        display(strings.iterator());
    }

}
